import request from '@/untils/request'
import configs from '@/configs'

// 获取供应商数据
const getSupplierData = function (data) {
  const url = configs.baseUrl + ''
  const promise = new Promise(function (resolve, reject) {
    resolve(request.get(url, data))
  })
  return promise
}

// 获取公告列表
const getNoticeList = function (data) {
  const url = configs.cmsURL + '/public/1/notice/page'
  const promise = new Promise(function (resolve, reject) {
    resolve(request.post(url, data))
  })
  return promise
}

// 获取公告详情
const getNoticeDetail = function (data) {
  const url = configs.cmsURL + '/public/1/notice/detail'
  const promise = new Promise(function (resolve, reject) {
    resolve(request.get(url, data))
  })
  return promise
}

// 获取单页文章 关于我们
const getAboutUs = function () {
  let url = configs.cmsURL + '/public/1/single/detail/?no=about-us'
  const promise = new Promise(function (resolve, reject) {
    resolve(request.get(url, {}))
  })
  return promise
}
// 获取单页文章 隐私政策
const getPrivacy = function () {
  let url = configs.cmsURL + '/public/1/single/detail/?no=privacy'
  const promise = new Promise(function (resolve, reject) {
    resolve(request.get(url, {}))
  })
  return promise
}

export default{
  getSupplierData,
  getNoticeList,
  getNoticeDetail,
  getAboutUs,
  getPrivacy
}
